<?php
namespace plugins\setting\controller;
use cmf\controller\PluginRestBaseController;
use plugins\setting\model\SettingModel;
use plugins\setting\lib\Common;
use plugins\setting\lib\Setting;

class ApiIndexController extends PluginRestBaseController
{
	public function index()
	{
		$index  = $this->request->param( 'index' );
		$set = new Setting( $index );
		dump( $set );
		$info = $set->getSettingInfo() ;
		$info [ 'setting_info' ]['content'] = 2;
		$set->setSettingInfo( $info );
		dump( $set );
		$res = $set->save();
		echo $res;

	}

	public function set()
	{
		$res = Common::getSettingInfo();
		dump( $res );
	}

	public function clear()
	{
		Common::clearSettingInfo();
	}

}